package Day4_07_26;

//16、题目：一个5位数，判断它是不是回文数。即12321是回文数，个位与万位相同，十位与千位相同。
import java.util.Scanner;

public class Num16 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入一个字符串");
		String str = scanner.next();// "abcba"
		char[] array = str.toCharArray();
		int sum = 0;
		for (int i = 0; i < array.length / 2; i++) {
			if (array[i] == array[array.length - 1 - i]) {
				sum++;
			}
		}
		if (sum == array.length / 2) {
			System.out.println(str + "是回文数");
		} else {
			System.out.println(str + "不是回文数");
		}
	}
}
